<template>
  <div class="newsInfo">
    <van-panel
      class="my-panel"
      :title="newsmessage.zhaiyao"
      :status="'阅读' + newsmessage.click + '次'"
    >
      <div class="content">{{ newsmessage.content }}</div>
    </van-panel>

    <Comment :id="id"></Comment>
  </div>
</template>
<script>
import { getNewsInfo } from "@/api";
import Comment from "@/components/Comment";
export default {
  props: ["id"],
  data() {
    return {
      newsid: 0,
      newsmessage: {},
    };
  },
  components: { Comment },
  created() {
    this.getNewsInfo();
  },
  methods: {
    async getNewsInfo() {
      const res = await getNewsInfo(this.id);
      this.newsmessage = res.data.message;
      // console.log(this.newsmessage);
    },
  },
};
</script>
<style lang="scss">
.newsInfo {
  padding: 0 10px;

  .van-cell__title {
    font-size: 16px;
    font-weight: 600;
  }
  .content {
    text-indent: 2em;
    font-size: 12px;
  }
  .my-panel {
    margin-bottom: 10px;
  }
}
</style>
